<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <title>系统邮件服务器设置</title>
	<meta http-equiv="pragma" content="no-cache">
	<meta http-equiv="cache-control" content="no-cache">
	<meta http-equiv="expires" content="0"> 
	<meta http-equiv="X-UA-Compatible" content="IE=edge" />
	<jsp:include page="../resource.jsp"></jsp:include>
	<style type="text/css">
	    #authority table, caption, tbody, tfoot, thead, tr, th, td{
	        vertical-align: middle;
	    }
	</style>
	<script type="text/javascript">
	$(document).ready(function() {
		$('#mailForm').submit(function() {
            $(this).omAjaxSubmit({
          	  url : 'mailConfig!save.do',
                success : function(data){
                   	if(data == '1'){  
                       	$.omMessageTip.show({timeout : 2000,content : '保存成功！'});
                       	$('#userPasswordEditor').omDialog('close');
                   	}else{
                   		$.omMessageTip.show({timeout : 2000,content : '保存失败！',type : 'error'});
                   	}
                }
            });
            return false;//返回false,阻止浏览器默认行为
      });
        	$.ajax({
  			  url: "mailConfig!findConfig.do",
  			  dataType : 'json',
  			  success: function(data){
    	        $("#configId").val(data[0].id);
  	        	$("#serviceHost").val(data[0].serviceHost);
  	        	$("#serviceAddress").val(data[0].serviceAddress);
  	        	$("#userName").val(data[0].userName);
  	        	$("#password").val(data[0].password);
  			  }
  			});
	});
	</script>  
  </head>
  
  <body>
    <div class="toolbar mar">
	</div>
	<form id="mailForm" method="post">
		<table width="60%" border="0" class="grid_layout" cellspacing="0">
             <tr>
               <td width="10%" align="right">服务器地址：</td>
               <td width="28%">
                 <input type="hidden" id="configId" name="mailConfig.id">
                 <input type="text" name="mailConfig.serviceHost" id="serviceHost" class="input_text"/>
               </td>
             </tr>
             <tr>
               <td width="10%" align="right">邮 箱 地 址：</td>
               <td width="28%">
                 <input type="text" name="mailConfig.serviceAddress" id="serviceAddress" class="input_text"/>
               </td>
             </tr>
             <tr>
               <td width="10%" align="right">用 &nbsp;&nbsp;户 &nbsp;&nbsp;名：</td>
               <td width="28%">
                 <input type="text"" name="mailConfig.userName" id="userName" class="input_text"/>
               </td>
             </tr>
             <tr>
               <td width="10%" align="right">密&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;码：</td>
               <td width="28%">
                  <input type="password"" id="password" name="mailConfig.password" class="input_text" >
               </td>
             </tr>
             <tr>
               <td align="center" colspan="2">
               	<button id="subform" type="submit"> 保&nbsp;&nbsp;&nbsp;&nbsp;存 </button>
               </td>
             </tr>
           </table>
	</form>
  </body>
</html>
